package org.log4jeditor.xml.editor.quickfix;

import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.log4jconfig.xml.editor.quickfix.AllDeprecatedElementsReplaceQuickFix;
import org.log4jconfig.xml.editor.quickfix.AnyDeprecatedElementQuickAssistProcessor;
import org.log4jeditor.xml.editor.AbstractUITestCase;

public class AnyDeprecatedElementQuickAssistProcessorTestCase extends AbstractUITestCase {

	private AnyDeprecatedElementQuickAssistProcessor processor  = null;
	
	@Before
	public void setup() {
		processor = new AnyDeprecatedElementQuickAssistProcessor();
	}
	
	@Test
	public void testCanAssist() {
		Assert.assertTrue(processor.canAssist(null));
	}

	@Test
	public void testCanFix() {
		Assert.assertTrue(processor.canFix(null));
	}

	@Test
	public void testComputeQuickAssistProposals() {
		ICompletionProposal[] proposals = processor.computeQuickAssistProposals(null);
		Assert.assertEquals(1, proposals.length);
		Assert.assertTrue(proposals[0] instanceof AllDeprecatedElementsReplaceQuickFix);
	}

	@Test
	public void testGetErrorMessage() {
		Assert.assertNotNull(processor.getErrorMessage());
	}

}
